<cfif action eq 'add'>

    <cfquery  datasource="101tf2" name="getDefault">
     
    select  id from list where defaultlist  = 'yes' and type = '#list#'
     
    </cfquery>
     
    <cfif getDefault.recordcount>
    	<cftry>
        <cfquery  datasource="101tf2" name="getDefault">
         
        insert into mylist (sid,lid) values ('#id#','#getDefault.id#')
         
        </cfquery>
        Item Added.
        
        <cfcatch>Already Added</cfcatch>
        </cftry>
    <cfelse>
    
        No default list found.
    </cfif>
<cfelseif  action eq 'remove'>
	<cfquery  datasource="101tf2" name="getDefault">
     
    select  id from list where defaultlist  = 'yes' and type = '#list#'
     
    </cfquery>
     
    <cfif getDefault.recordcount>
    	<cftry>
        <cfquery  datasource="101tf2" name="getDefault">
         
        delete from mylist where lid='#getDefault.id#' and sid ='#id#'
         
        </cfquery>
        Item Removed.
        <cfcatch>Already Added</cfcatch>
        </cftry>
    <cfelse>
    
        No default list found.
    </cfif>	
</cfif>